<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<FitnessMVC.Data.BlogPost>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
	NewPost
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="HeadContent" runat="server">
	<script type="text/javascript">
	    $(document).ready(function() {
	        $("#postContentsBox").markItUp();
	    });
	</script>
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">

    <h2>NewPost</h2>

    <%= Html.ValidationSummary("Create was unsuccessful. Please correct the errors and try again.") %>

    <% using (Html.BeginForm()) {%>

        <fieldset>
            <legend>Fields</legend>
            
            <p>
                <label for="Title">Title:</label>
                <%= Html.TextBox("Title") %>
                <%= Html.ValidationMessage("Title", "*") %>
            </p>
            <p>
                <label for="Contents">Contents:</label>
                <%= Html.TextArea("Contents", new { id = "postContentsBox", rows=20, cols=120 }) %>
                <%= Html.ValidationMessage("Contents", "*") %>
            </p>
            <p>
                <label for="DatePosted">DatePosted:</label>
                <%= Html.TextBox("DatePosted", String.Format("{0:MM-dd-yyyy}", DateTime.Now)) %>
                <%= Html.ValidationMessage("DatePosted", "*") %>
            </p>
            <p>
                <label for="Publish">Publish:</label>
                <%= Html.CheckBox("Publish", true) %>
                <%= Html.ValidationMessage("Publish", "*") %>
            </p>
            <p>
                <%= Html.AntiForgeryToken("saltypost") %>
                <input type="submit" value="Create" />
            </p>
        </fieldset>

    <% } %>

    <div>
        <%=Html.ActionLink("Back to List", "Index") %>
    </div>

</asp:Content>

